#include "LocalMath.h"
//一阶低通滤波,公式Yn = K * X + (1-K)*YLast
//K_Q16为Q16格式定点数
uint16_t lowPassFilter(uint16_t K_Q16,uint16_t X,uint16_t YLast)
{
    uint16_t retval = (uint16_t)((K_Q16 * X)>>16) + (uint16_t)(((65536-K_Q16)*YLast )>>16 );
    return retval;
}
